package io.finer.erp.jeecg.bas.service.impl;

import io.finer.erp.jeecg.bas.entity.ZrkYwSalary;
import io.finer.erp.jeecg.bas.mapper.ZrkYwSalaryMapper;
import io.finer.erp.jeecg.bas.service.IZrkYwSalaryService;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 业务底薪设置
 * @Author: jeecg-boot
 * @Date:   2020-09-18
 * @Version: V1.0
 */
@Service
public class ZrkYwSalaryServiceImpl extends ServiceImpl<ZrkYwSalaryMapper, ZrkYwSalary> implements IZrkYwSalaryService {

	@Override
	public ZrkYwSalary getByUserId(String id) {
		LambdaQueryWrapper<ZrkYwSalary> query = new LambdaQueryWrapper<>();
		query.eq(ZrkYwSalary::getUserId, id);
		List<ZrkYwSalary> list = list(query);
		if(null != list && 0 != list.size()) {
			return list.get(0);
		}
		return null;
	}

}
